All Questions
15 questions
1vote
1answer
122views
Inserting a file without altering the folder's modification timestamp?
I have hundreds of folders with modification timestamps I'd like to preserve. Now I need to copy a single file into them. Aside from this way... timestamp=$(stat -c %y /foldername) cp /tmp/file.jpg /...
2votes
1answer
258views
Why fcntl() range lock (some offset to length) is slower as compared to fcntl full file lock (0 offset to EOF)? [closed]
I am trying to write on 1 GB file from 8 different processes (every process will start writing from 0th offset till EOF) simultaneously; while following two different approaches. Before writing every ...
0votes
1answer
1kviews
Does ext3grep work on ext4?
Does ext3grep work on ext4? It is recommended in https://unix.stackexchange.com/a/237142/674 and https://askubuntu.com/a/217632/. In the first link, its option to specify the time window of deletion ...
1vote
1answer
358views
How to use ext4 inline_data to store empty directories?
How can I use ext4's inline_data feature to store empty directories? It seems like inline_data works only with small files, or the directories store a lot of data.
24votes
3answers
6kviews
What happens when I kill 'cp'? Is it safe and does it have any consequences?
What are the consequences for a ext4 filesystem when I terminate a copying cp command by typing Ctrl + C while it is running? Does the filesystem get corrupted? Is the partition's space occupied by ...
21votes
5answers
15kviews
Millions of (small) text files in a folder
We would like to store millions of text files in a Linux filesystem, with the purpose of being able to zip up and serve an arbitrary collection as a service. We've tried other solutions, like a key/...
2votes
1answer
999views
Why symbolic links have no data blocks allocated to them in ext4fs?
I am a Unix wanderer. I just noticed that symlinks don't have data blocks allocated to them, I think the inode of the symlink file stores the filename which the symlink refers to, is this actually the ...
3votes
2answers
2kviews
When is a file freed in an ext file system?
Introduction Until recently, I thought that on ext file system, inodes have reference counters which count the number of times the file is referenced by a directory entry or a file descriptor. Then, ...
0votes
2answers
2kviews
Recover specific files from deleted EXT4 partition
Is there any way to recover a few specific files from a deleted EXT4 partition. I deleted all partitions on my 480GB SSD. Afterwards, I created a 200 GB NTFS partition (which is mostly empty) and I ...
51votes
8answers
243kviews
Cannot remove file: "Structure needs cleaning"
I have an external hard drive which is encrypted via LUKS. It contains an ext4 fs. I just got an error from rsync for a file which is located on this drive: rsync: readlink_stat("/home/some/dir/...
1vote
1answer
635views
ext4 or NTFS lost all files of the last 2 years. How can I recover them?
Problem Suddently, all the files from feb-2015 to nov-2016 have disappeared from the filesystem. Context Over the last 2 years, the system repeatedly terminated abruptly for power-fail reasons or ...
1vote
1answer
2kviews
How to use tune2fs?
I want to adjust the time interval between ext2, ext3 and ext4 filesystem checks to 180 days? I know that I have to use tune2fs -i 180 but I am not sure about the arguments
0votes
2answers
525views
Precaching the list of files of the filesystem
I was wondering where and in what form a list of files and directories is stored on the ext4 filesystem. The problem is that whenever I try to access a certain directory for the first time since boot ...
1vote
1answer
5kviews
Why the size of an empty directory in Linux is 4KB? [duplicate]
I'm using Ubuntu 14.04 and I made an empty directory on /tmp with the mkdir command: cd /tmp mkdir foo and then I checked it's size using ls: ls -ldh foo and the result shows that the size of the ...
5votes
3answers
14kviews
How can I change the date modified of a folder to the last changed file inside? [duplicate]
In my media center directory all modified times of my folders are somehow not the desired date. How can I change all modified times of the main folders to the modified time of the newest media-file ...